google.load('visualization', '1.0', {'packages':['corechart']}); google.setOnLoadCallback(function(){ var data = new google.visualization.DataTable(); data.addColumn('string', '日'); data.addColumn('number', '推測'); data.addColumn('number', '推測'); data.addColumn('number', 'iOS前月'); data.addColumn('number', 'iOS当月'); data.addRows([ ['1日',326,364,null,null], ['2日',399,395,null,null], ['3日',444,431,null,null], ['4日',477,497,null,null], ['5日',502,548,null,null], ['6日',516,475,null,null], ['7日',558,521,null,null], ['8日',605,537,null,null], ['9日',416,574,null,null], ['10日',442,620,null,null], ['11日',490,447,null,null], ['12日',484,479,null,null], ['13日',537,462,null,null], ['14日',610,514,null,null], ['15日',520,574,null,null], ['16日',538,550,null,null], ['17日',467,465,null,null], ['18日',520,533,null,null], ['19日',458,655,null,null], ['20日',463,461,null,null], ['21日',463,481,null,null], ['22日',508,503,null,null], ['23日',411,511,null,null], ['24日',424,584,null,null], ['25日',434,574,null,null], ['26日',483,460,null,null], ['27日',459,431,null,null], ['28日',461,473,null,null], ['29日',497,453,null,null], ['30日',539,516,null,null], ['31日',324,null,null,null] ]); var options = { chartArea: {'width':'85%', 'height':'65%', 'left':60 }, 'pointSize': 3, hAxis: { titleTextStyle:{italic:false}, format:'#',ticks: [1,5,10,15,20,25,30] }, vAxis: { title:'2024年4月ランキング', titleTextStyle:{italic:false}, format:'#',viewWindow:{min:0,max:700},direction:-1 }, legend: {position: 'top' }, tooltip: { trigger: 'both' }, focusTarget: 'category', colors:['skyblue','pink','#2980b9','#e74c3c'] }; var chart = new google.visualization.LineChart(document.getElementById('graphField')); chart.draw(data, options); var lastlogday=30 -1 ; var lastlogcat=2; if(lastlogday>=0){ chart.setSelection([{ row: lastlogday, column: lastlogcat }]); google.visualization.events.addListener(chart, 'click', function() { if(chart.getSelection()[0]){ //chart.setSelection(null) } }); } });